package com.hdaccp.foodsales.service.impl;

import com.hdaccp.foodsales.dao.ShangpinDao1;
import com.hdaccp.foodsales.entity.Danwei;
import com.hdaccp.foodsales.entity.Shangpin;
import com.hdaccp.foodsales.entity.Xiaoclass;
import com.hdaccp.foodsales.service.ShangpinService1;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ShangpinServiceImpl1 implements ShangpinService1 {
    @Autowired
    private ShangpinDao1 shangpinDao;
    @Override
    public List<Shangpin> queryPage(String sname, int offset, int limit) {
        return shangpinDao.queryPage(sname,offset,limit);
    }

    @Override
    public int countA(String sname) {
        return shangpinDao.count(sname);
    }

    @Override
    public int deleteA(int sid) {
        return shangpinDao.delete(sid);
    }


    /**
     * 商品增加
     * @param shangpin
     * @return
     */
    public int addA(Shangpin shangpin){
        return shangpinDao.add(shangpin);
    }

    @Override
    public int updateA(Shangpin shangpin) {
        return shangpinDao.update(shangpin);
    }

    @Override
    public Shangpin getsid1(int sid) {
        return shangpinDao.getsid(sid);
    }

    @Override
    public List<Xiaoclass> select1() {
        return shangpinDao.select();
    }

    @Override
    public List<Danwei> selectdw() {
        return shangpinDao.selectdw();
    }


}
